package com.damage.purchase_dept.mapper;

import com.damage.common.dto.OrderSender;
import com.damage.common.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IOrderMapper {

    Integer insert(Order order);

    Integer setProcessInstanceId(@Param("id") Integer id,
                                 @Param("processInstanceId") String processInstanceId);

    Integer purchasePlanGenerated(Integer purchasePlanId);

    Order findById(Integer id);

    List<Order> findOrderByPurchasePlanId(Integer purchasePlanId);

    List<Order> findOrderByState(Integer state);

    Integer deleteByPurchasePlanId(Integer purchasePlanId);

    Integer sendOrder(@Param("orderId") Integer orderId,
                      @Param("orderSender") OrderSender orderSender);
}
